/**
 * 
 */
package com.taobao.wolfwolf.hibernate.dao.impl;

import java.util.List;

import com.taobao.wolfwolf.hibernate.dao.ReceiverAddressDao;
import com.taobao.wolfwolf.hibernate.pojo.ReceiverAddress;

/**
 * @author Tux
 *
 * 创建时间: 2011-4-29 上午09:45:11
 */
@SuppressWarnings("unchecked")
public class ReceiverAddressDaoImpl extends BaseDaoImpl implements ReceiverAddressDao {
	
	public ReceiverAddress findById(int id) throws Exception {
		return (ReceiverAddress) getHibernateTemplate().get(ReceiverAddress.class, id);
	}
	
	public List<ReceiverAddress> findByName(String name) throws Exception {
		return super.findByProperty(ReceiverAddress.class, "name", name);
	}

	public List<ReceiverAddress> findAll() throws Exception {
		return getHibernateTemplate().find("from ReceiverAddress");
	}

	public long getTotal() throws Exception {
		return super.countByCriteria(ReceiverAddress.class);
	}
}
